﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DTO;
using DAO;

namespace BUS
{
    public class ThietBiBUS
    {
        public List<ThietBiDTO> LayDanhSachThietBi()
        {
            ThietBiDAO dao = new ThietBiDAO();
            List<ThietBiDTO> ds = dao.LayDanhSachThietBi();
            return ds;
        }

        public List<ThietBiDTO> LayDanhSachThietBiTheoMaLoaiThietBi(int ma)
        {
            ThietBiDAO dao = new ThietBiDAO();
            List<ThietBiDTO> ds = dao.LayDanhSachThietBiTheoMaLoaiThietBi(ma);
            return ds;
        }

        public ThietBiDTO LayThongTinThietBi(int ma)
        {
            ThietBiDAO dao = new ThietBiDAO();
            ThietBiDTO dto = dao.LayThongTinThietBi(ma);
            return dto;
        }

        public int LaySoLuongThietBi()
        {
            ThietBiDAO dao = new ThietBiDAO();
            int sl = dao.LaySoLuongThietBi();
            return sl;
        }

        public int LaySoLuongTon(int ma)
        {
            ThietBiDAO dao = new ThietBiDAO();
            int sl = dao.LaySoLuongTon(ma);
            return sl;
        }

        public int LaySoLuongThietBiTheoMaLoaiThietBi(int ma)
        {
            ThietBiDAO dao = new ThietBiDAO();
            int sl = dao.LaySoLuongThietBiTheoMaLoaiThietBi(ma);
            return sl;
        }

        public int LayMaThietBiCaoNhat()
        {
            ThietBiDAO dao = new ThietBiDAO();
            int ma = dao.LayMaThietBiCaoNhat();
            return ma;
        }

        public void ThemThietBi(ThietBiDTO dto)
        {
            ThietBiDAO dao = new ThietBiDAO();
            dao.ThemThietBi(dto);
        }

        public void XoaThietBi(int ma)
        {
            ThietBiDAO dao = new ThietBiDAO();
            dao.XoaThietBi(ma);
        }

        public void XoaThietBiTheoMaLoaiThietBi(int ma)
        {
            ThietBiDAO dao = new ThietBiDAO();
            dao.XoaThietBiTheoMaLoaiThietBi(ma);
        }

        public void CapNhatThietBi(ThietBiDTO dto)
        {
            ThietBiDAO dao = new ThietBiDAO();
            dao.CapNhatThietBi(dto);
        }

        public void CapNhatSoLuongTon(int ma, int sl)
        {
            ThietBiDAO dao = new ThietBiDAO();
            dao.CapNhatSoLuongTon(ma, sl);
        }

        public void CapNhatGiaNhap(int ma, double gia)
        {
            ThietBiDAO dao = new ThietBiDAO();
            dao.CapNhatGiaNhap(ma, gia);
        }

        public void CapNhatGiaBan(int ma, double gia)
        {
            ThietBiDAO dao = new ThietBiDAO();
            dao.CapNhatGiaBan(ma, gia);
        }

        public List<ThietBiDTO> TimKiemThietBiTatCaTieuChi(string str)
        {
            ThietBiDAO dao = new ThietBiDAO();
            List<ThietBiDTO> ds = dao.TimKiemThietBiTatCaTieuChi(str);
            return ds;
        }

        public List<ThietBiDTO> TimKiemThietBiTheoLoaiThietBiTatCaTieuChi(string str, int ma)
        {
            ThietBiDAO dao = new ThietBiDAO();
            List<ThietBiDTO> ds = dao.TimKiemThietBiTheoLoaiThietBiTatCaTieuChi(str, ma);
            return ds;
        }

        public List<ThietBiDTO> TimKiemThietBiTheoTen(string str)
        {
            ThietBiDAO dao = new ThietBiDAO();
            List<ThietBiDTO> ds = dao.TimKiemThietBiTheoTen(str);
            return ds;
        }

        public List<ThietBiDTO> TimKiemThietBiTheoLoaiThietBi(string str)
        {
            ThietBiDAO dao = new ThietBiDAO();
            List<ThietBiDTO> ds = dao.TimKiemThietBiTheoLoaiThietBi(str);
            return ds;
        }

        public List<ThietBiDTO> TimKiemThietBiTheoXuatXu(string str)
        {
            ThietBiDAO dao = new ThietBiDAO();
            List<ThietBiDTO> ds = dao.TimKiemThietBiTheoXuatXu(str);
            return ds;
        }

        public List<ThietBiDTO> TimKiemThietBiTheoChucNang(string str)
        {
            ThietBiDAO dao = new ThietBiDAO();
            List<ThietBiDTO> ds = dao.TimKiemThietBiTheoChucNang(str);
            return ds;
        }

        public List<ThietBiDTO> TimKiemThietBiTheoIMEI(string str)
        {
            ThietBiDAO dao = new ThietBiDAO();
            List<ThietBiDTO> ds = dao.TimKiemThietBiTheoIMEI(str);
            return ds;
        }

        public List<ThietBiDTO> TimKiemThietBiTheoGia(double gia)
        {
            ThietBiDAO dao = new ThietBiDAO();
            List<ThietBiDTO> ds = dao.TimKiemThietBiTheoGia(gia);
            return ds;
        }

        public List<ThietBiDTO> TimKiemThietBiTheoSoLuongTon(int sl)
        {
            ThietBiDAO dao = new ThietBiDAO();
            List<ThietBiDTO> ds = dao.TimKiemThietBiTheoSoLuongTon(sl);
            return ds;
        }
    }
}
